import request from '@/utils/request'

export function fetchList(params) {
  return request({
    url:'/product/productAttribute/category/list',
    method:'get',
    params:params
  })
}


export function createProductAttrCate(data) {
  return request({
    url:'/product/productAttribute/category/create',
    method:'post',
    data:data
  })
}

export function deleteProductAttrCate(id) {
  return request({
    url:'/product/productAttribute/category/delete/'+id,
    method:'get'
  })
}

export function updateProductAttrCate(id,data) {
  return request({
    url:'/product/productAttribute/category/update/'+id,
    method:'post',
    data:data
  })
}
export function fetchListWithAttr() {
  return request({
    url:'/product/productAttribute/category/list/withAttr',
    method:'get'
  })
}



// 查询产品属性分类列表
export function listCategory(query) {
  return request({
    url: '/product/productAttribute/category/r/list',
    method: 'get',
    params: query
  })
}

// 查询产品属性分类详细
export function getCategory(id) {
  return request({
    url: '/product/productAttribute/category/' + id,
    method: 'get'
  })
}

// 新增产品属性分类
export function addCategory(data) {
  return request({
    url: '/product/productAttribute/category',
    method: 'post',
    data: data
  })
}

// 修改产品属性分类
export function updateCategory(data) {
  return request({
    url: '/product/productAttribute/category',
    method: 'put',
    data: data
  })
}

// 删除产品属性分类
export function delCategory(id) {
  return request({
    url: '/product/productAttribute/category/' + id,
    method: 'delete'
  })
}


